1. Field of the Invention
The present invention generally relates to computer graphics, and, more specifically, to a method and system for generating a displacement map from a normal map.
2. Description of the Related Art
Conventionally, graphics processing systems have relied on techniques such as bump mapping to produce realistic lighting effects in computer-generated images. In bump mapping, the surface normals of a polygon mesh are calculated and stored in a normal map. During rendering, the normal map is used to perform lighting calculations, which are applied to a lower-resolution version of the polygon mesh. In this way, geometric details present on the original polygon mesh can be simulated and applied to a lower-resolution polygon mesh in order to conserve computational resources. Although bump mapping is capable of simulating the lighting of the original object, the underlying geometry of the lower-resolution object is unchanged. Consequently, bump mapping cannot accurately produce silhouettes, occlusion, and shadows, revealing the coarseness of the object's underlying geometry.
As the processing power of graphics systems increases, it has become possible to render images having higher and higher polygon counts. Accordingly, current graphics application programming interfaces (APIs) (e.g., DirectX 11) have begun to implement functions that enable more sophisticated control over geometry shaders, such as the ability to perform tessellation of incoming graphics primitives. Through tessellation, developers have the ability to increase the geometric detail of an object by generating additional graphics primitives and displacing the vertices of those primitives to more realistically reproduce the geometric details of the object. However, as discussed above, many existing graphic assets were designed to be used with techniques (e.g., bump mapping) that do not affect object geometries and were not designed or intended to be used with tessellation. Consequently, existing graphic assets typically lack the geometric information (e.g., depth information) needed to generate realistic and detailed object geometries with the additional vertices created during tessellation. Moreover, the process of converting existing graphic assets to take advantage of tessellation, as well as other sophisticated geometric processing techniques included in current graphics APIs, is time-consuming and expensive. Thus, given the financial risks and uncertain return on investment, few developers are willing to expend the resources necessary to update existing graphic assets to include the required geometric information.
Accordingly, what is needed in the art is an approach that allows existing graphic assets to be used in conjunction with the functions of more advanced graphics APIs that enable more sophisticated control over object geometries.